#include <stdbool.h>
#define MaxSize 100
#define PI 3.14159265f

typedef struct CharStack //字符栈
{
    char data[MaxSize];
    int top;
} charStack;

typedef struct DoubleStack //数据栈
{
    double data[MaxSize];
    int top;
} dataStack;

int Isop(char); //当前扫描元素优先级
int Inop(char); //栈顶元素优先级

void Initc(charStack *); //初始化字符栈

int Pushc(charStack *, char); //字符栈压栈
char Gettopc(charStack *);    //返回栈顶元素
char Popc(charStack *);       //字符出栈

void Initd(dataStack *);        //初始化数据栈
int Pushd(dataStack *, double); //数据压栈
double Popd(dataStack *);       //数据出栈

void Transform(char *s1, char *s2); //转化为后缀表达式

double Calculate(char *s2);   //后缀表达式求值
bool judge_infix(char str[]); //判断输入合法性